package cn.wizzer.app.user.modules.services;

import cn.wizzer.app.user.modules.models.User;
import cn.wizzer.app.user.modules.models.enums.EquipmentEnum;
import cn.wizzer.framework.base.service.BaseService;
import cn.wizzer.framework.page.Pagination;
import org.nutz.lang.util.NutMap;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;


public interface UserService extends BaseService<User> {
    void insertUser(User user, String inviteCode);

    void deleteById(String id);

    Pagination listPage(Class clazz, Integer pageNumber, int pageSize, String sql, String countSql);

    /**
     * 后台用户列表
     *
     * @param userType      用户类型(主播、普通用户)
     * @param i
     * @param searchKeyword 关键字
     * @param searchDate    日期
     * @param attendant
     * @param pageNumber
     * @param pageSize
     * @return
     */
    Pagination userList(Integer userType, Integer i, String searchKeyword, String[] searchDate, Integer isOnline, Integer attendant, int pageNumber, int pageSize);

    /**
     * 后台用户列表
     *
     * @param conditionData
     * @param searchKeyword
     * @param searchDate
     * @param pageNumber
     * @param pageSize
     * @return
     */
    Pagination userListNew(String conditionData, String searchKeyword, String[] searchDate, int pageNumber, int pageSize);

    /**
     * 校验昵称是否符合规范
     *
     * @param nickName 昵称
     * @return
     */
    boolean checkNickName(String nickName);


    /**
     * 邀请列表
     *
     * @param appid
     * @return
     */
    Pagination inviteList(String appid, int pageNumber, int pageSize);

    /**
     * 修改用户
     *
     * @param user
     */
    void updateUser(User user);

    NutMap login(String phone, String password, EquipmentEnum equipment, String ip);

    void offLine();

    Map<String, User> findByIds(List<String> ids);

    Map<String, String> usersToMapJSONString(List<User> users);

    BigDecimal calculateLoginDuration(String userId);

    Pagination anchorList(String userId, int pageNumber, int pageSize);

    void userRebateJob(User user);
}
